
from py_code.driver.Driver import Driver
from py_code.net.Net import NetData
import socketserver
from py_code.SingletonType import SingletonType


class DataNet(Driver, metaclass = SingletonType):
    """
    常规数据网络，保证数据正确发送和接收，适用于数据量较小的文本数据
    注意，此类虽然也是驱动，但最好不要放到DriverManager中管理
    """

    server: socketserver.ThreadingTCPServer
    addr = ('localhost', 16060)
    
    def open(self):
        super().open()
        self.server = socketserver.ThreadingTCPServer(self.addr, )

    def send(self, data: NetData):
        pass
